<% announcements.each_with_index do |announcement, index| %>

          <div class="ann-date"><%=h (Time.now.day == announcement.created_at.day and
              Time.now.month == announcement.created_at.month) ?
                announcement.created_at.strftime("%I:%M %p") :
                announcement.created_at.strftime("%A, %B %d, %Y") %></div>

          <div class="ann-mess"><%=h announcement.message %></div>

          <div class="ann-auth"><%= link_to h(announcement.member.full_name),
        :controller => "members", :action => "show", :id => announcement.member.id %></div>

        <% if session[:user].admin? or session[:user].id == announcement.member.id %>

          <div class="ann-auth"><%= link_to_function "x",
                "if (confirm('Are you sure you want to delete this post?')) window.location = 'delete_post?id=#{announcement.id}'" %></div>

        <% end %>

<% end %>